fix: highlight favourite icon and sort favourites alphabetically#255
Conversation
The heart icon now shows ❤️ for favourites and 🤍 for non-favourites, with brighter text when the app is marked as a favourite. Previously the icon looked the same regardless of favourite status. Favourites are now sorted alphabetically by display name. Closes RustCastLabs#254
src/styles.rs
Outdated
| status: button::Status, | ||
| is_favourite: bool, | ||
| ) -> button::Style { | ||
| let text_color = if is_favourite { |
There was a problem hiding this comment.
can we bring out the match statement?
Maybe it would be possible to just:
let (press_opacity, hover_clr) = if is_favourite {
// evaluate opacity here
}
src/app/apps.rs
Outdated
| let name = self.search_name.clone(); | ||
| let theme_clone = theme.clone(); | ||
| let is_favourite = self.ranking == -1; | ||
| let heart = if is_favourite { "❤️" } else { "🤍" }; |
There was a problem hiding this comment.
to iced they're the same
unsecretised
left a comment
There was a problem hiding this comment.
Looks mostly good, just a bit of code quality and the fact that iced doesn't actually care about the colour of the emoji.. its going to be the same.
Also, I'm not sure if there was AI used in this. Do let me know if there was, and how much.
d77467e to
5a0a123
Compare
|
Addressed both points:
Re AI: used it minimally to find the issue and understand the codebase structure. Probably should have leaned on it more for the iced emoji thing honestly |
|
LGTM then |
|
Show ❤️ for favourites and 🤍 for non-favourites would prefer white highlighted for fav. and greyed out for non favs. keeps it from becoming a 🎄 |
Problem
The favourite heart icon looks the same regardless of whether an app is actually favourited. There's no visual feedback after toggling.
Additionally, the favourites list isn't sorted, making it harder to find apps.
Fix
Changes
styles.rs:favourite_button_styletakes anis_favouriteparam to adjust text brightnessapps.rs: picks heart emoji and passes favourite state to the style functiontile.rs:get_favouritessorts results bydisplay_nameCloses #254